package durst.utils;

public class ConfigParser {
	private static java.util.Properties prop = new java.util.Properties();

	private static void loadProperties() {
		// get class loader
		ClassLoader loader = ConfigParser.class.getClassLoader();
		if (loader == null)
			loader = ClassLoader.getSystemClassLoader();

		java.net.URL url = loader.getResource("durst.properties");
		try {
			prop.load(url.openStream());
		}
		catch (Exception e) {
			System.err.println("Could not load configuration file:");
		}
	}

	// load the properties when class is accessed
	static {
		loadProperties();
	}
	
	public static String getProp(String key) {
		return (String)prop.get(key);
	}
}
